<!DOCTYPE html>

<html lang="en" data-content_root="../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <title>VERSION &mdash; CMake 4.1.1 Documentation</title>

    <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=a2c47e09" />
    <link rel="stylesheet" type="text/css" href="../_static/cmake.css?v=4d06bd55" />
    
    <script src="../_static/documentation_options.js?v=e6a937a4"></script>
    <script src="../_static/doctools.js?v=9bcbadda"></script>
    <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
    
    <link rel="icon" href="../_static/cmake-favicon.ico"/>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="VISIBILITY_INLINES_HIDDEN" href="VISIBILITY_INLINES_HIDDEN.html" />
    <link rel="prev" title="VERIFY_INTERFACE_HEADER_SETS" href="VERIFY_INTERFACE_HEADER_SETS.html" />
 

  </head><body>
    <input id="sidebar-check" type="checkbox" />
    <label id="sidebar-overlay" for="sidebar-check"></label>



    <div class="related relbar1" role="navigation" aria-label="Related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="VISIBILITY_INLINES_HIDDEN.html" title="VISIBILITY_INLINES_HIDDEN"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="VERIFY_INTERFACE_HEADER_SETS.html" title="VERIFY_INTERFACE_HEADER_SETS"
             accesskey="P">previous</a> |</li>
  <li>
    <label class="sidebar-toggle" for="sidebar-check"></label>
  </li>
  <li class="rootlink">
    <img src="../_static/cmake-logo-16.png" width="16" height="16" alt=""/>
    <a href="https://cmake.org/">CMake 4.1.1</a>
    <span class="reldelim1"> &#187;</span>
  </li>
  <li>
    <a href="../index.html">Documentation</a> &#187;
  </li>

          <li class="nav-item nav-item-1"><a href="../manual/cmake-properties.7.html" accesskey="U">cmake-properties(7)</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">VERSION</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="version">
<span id="prop_tgt:VERSION"></span><h1>VERSION<a class="headerlink" href="#version" title="Link to this heading">¶</a></h1>
<p>Version number of a shared library target.</p>
<p>For shared libraries <code class="docutils literal notranslate"><span class="pre">VERSION</span></code> and <span class="target" id="index-0-prop_tgt:SOVERSION"></span><a class="reference internal" href="SOVERSION.html#prop_tgt:SOVERSION" title="SOVERSION"><code class="xref cmake cmake-prop_tgt docutils literal notranslate"><span class="pre">SOVERSION</span></code></a> can be used
to specify the build version and ABI version respectively.  When building or
installing appropriate symlinks are created if the platform supports
symlinks and the linker supports so-names.  If only one of both is
specified the missing is assumed to have the same version number.  For
executables <code class="docutils literal notranslate"><span class="pre">VERSION</span></code> can be used to specify the build version.  When
building or installing appropriate symlinks are created if the
platform supports symlinks.</p>
<p>A common convention is to specify both <code class="docutils literal notranslate"><span class="pre">VERSION</span></code> and <code class="docutils literal notranslate"><span class="pre">SOVERSION</span></code>
such that <code class="docutils literal notranslate"><span class="pre">SOVERSION</span></code> matches the first component of <code class="docutils literal notranslate"><span class="pre">VERSION</span></code>:</p>
<div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">set_target_properties(</span><span class="nb">mylib</span><span class="w"> </span><span class="no">PROPERTIES</span><span class="w"> </span><span class="no">VERSION</span><span class="w"> </span><span class="m">1.2.3</span><span class="w"> </span><span class="no">SOVERSION</span><span class="w"> </span><span class="m">1</span><span class="nf">)</span>
</pre></div>
</div>
<p>The idea is that breaking changes to the ABI increment both the
<code class="docutils literal notranslate"><span class="pre">SOVERSION</span></code> and the major <code class="docutils literal notranslate"><span class="pre">VERSION</span></code> number.</p>
<section id="windows-versions">
<h2>Windows Versions<a class="headerlink" href="#windows-versions" title="Link to this heading">¶</a></h2>
<p>For shared libraries and executables on Windows the <code class="docutils literal notranslate"><span class="pre">VERSION</span></code>
attribute is parsed to extract a <code class="docutils literal notranslate"><span class="pre">&lt;major&gt;.&lt;minor&gt;</span></code> version number.
These numbers are used as the image version of the binary.</p>
</section>
<section id="mach-o-versions">
<h2>Mach-O Versions<a class="headerlink" href="#mach-o-versions" title="Link to this heading">¶</a></h2>
<p>For shared libraries and executables on Mach-O systems (e.g. macOS, iOS),
the <span class="target" id="index-1-prop_tgt:SOVERSION"></span><a class="reference internal" href="SOVERSION.html#prop_tgt:SOVERSION" title="SOVERSION"><code class="xref cmake cmake-prop_tgt docutils literal notranslate"><span class="pre">SOVERSION</span></code></a> property corresponds to the <em>compatibility version</em>
and <code class="docutils literal notranslate"><span class="pre">VERSION</span></code> corresponds to the <em>current version</em> (unless Mach-O specific
overrides are provided, as discussed below).
See the <span class="target" id="index-0-prop_tgt:FRAMEWORK"></span><a class="reference internal" href="FRAMEWORK.html#prop_tgt:FRAMEWORK" title="FRAMEWORK"><code class="xref cmake cmake-prop_tgt docutils literal notranslate"><span class="pre">FRAMEWORK</span></code></a> target property for an example.</p>
<p>For shared libraries, the <span class="target" id="index-0-prop_tgt:MACHO_COMPATIBILITY_VERSION"></span><a class="reference internal" href="MACHO_COMPATIBILITY_VERSION.html#prop_tgt:MACHO_COMPATIBILITY_VERSION" title="MACHO_COMPATIBILITY_VERSION"><code class="xref cmake cmake-prop_tgt docutils literal notranslate"><span class="pre">MACHO_COMPATIBILITY_VERSION</span></code></a> and
<span class="target" id="index-0-prop_tgt:MACHO_CURRENT_VERSION"></span><a class="reference internal" href="MACHO_CURRENT_VERSION.html#prop_tgt:MACHO_CURRENT_VERSION" title="MACHO_CURRENT_VERSION"><code class="xref cmake cmake-prop_tgt docutils literal notranslate"><span class="pre">MACHO_CURRENT_VERSION</span></code></a> properties can be used to
override the <em>compatibility version</em> and <em>current version</em> respectively.
Note that <span class="target" id="index-2-prop_tgt:SOVERSION"></span><a class="reference internal" href="SOVERSION.html#prop_tgt:SOVERSION" title="SOVERSION"><code class="xref cmake cmake-prop_tgt docutils literal notranslate"><span class="pre">SOVERSION</span></code></a> will still be used to form the
<code class="docutils literal notranslate"><span class="pre">install_name</span></code> and both <span class="target" id="index-3-prop_tgt:SOVERSION"></span><a class="reference internal" href="SOVERSION.html#prop_tgt:SOVERSION" title="SOVERSION"><code class="xref cmake cmake-prop_tgt docutils literal notranslate"><span class="pre">SOVERSION</span></code></a> and <code class="docutils literal notranslate"><span class="pre">VERSION</span></code> may also
affect the file and symlink names.</p>
<p>Versions of Mach-O binaries may be checked with the <code class="docutils literal notranslate"><span class="pre">otool</span> <span class="pre">-L</span> <span class="pre">&lt;binary&gt;</span></code>
command.</p>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
  <div>
    <h3>Table of Contents</h3>
    <ul>
<li><a class="reference internal" href="#">VERSION</a><ul>
<li><a class="reference internal" href="#windows-versions">Windows Versions</a></li>
<li><a class="reference internal" href="#mach-o-versions">Mach-O Versions</a></li>
</ul>
</li>
</ul>

  </div>
  <div>
    <h4>Previous topic</h4>
    <p class="topless"><a href="VERIFY_INTERFACE_HEADER_SETS.html"
                          title="previous chapter">VERIFY_INTERFACE_HEADER_SETS</a></p>
  </div>
  <div>
    <h4>Next topic</h4>
    <p class="topless"><a href="VISIBILITY_INLINES_HIDDEN.html"
                          title="next chapter">VISIBILITY_INLINES_HIDDEN</a></p>
  </div>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/prop_tgt/VERSION.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="Related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="VISIBILITY_INLINES_HIDDEN.html" title="VISIBILITY_INLINES_HIDDEN"
             >next</a> |</li>
        <li class="right" >
          <a href="VERIFY_INTERFACE_HEADER_SETS.html" title="VERIFY_INTERFACE_HEADER_SETS"
             >previous</a> |</li>
  <li>
    <label class="sidebar-toggle" for="sidebar-check"></label>
  </li>
  <li class="rootlink">
    <img src="../_static/cmake-logo-16.png" width="16" height="16" alt=""/>
    <a href="https://cmake.org/">CMake 4.1.1</a>
    <span class="reldelim1"> &#187;</span>
  </li>
  <li>
    <a href="../index.html">Documentation</a> &#187;
  </li>

          <li class="nav-item nav-item-1"><a href="../manual/cmake-properties.7.html" >cmake-properties(7)</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="">VERSION</a></li> 
      </ul>
    </div>

    <div class="footer" role="contentinfo">
    &#169; Copyright 2000-2025 Kitware, Inc. and Contributors.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 8.1.3.
    </div>
<script type="text/javascript">
(function() {
  "use strict";
  const hide = () => document.getElementById("sidebar-check").checked = false;
  addEventListener("keydown", e => (e.key === "Escape") && hide());
  addEventListener("click", e => (e.target.tagName === "A") && hide());
  addEventListener("hashchange", hide)
})();
</script>
  </body>
</html>